﻿using Microsoft.Extensions.DependencyInjection;
using System;

namespace Developer.Core.FrameWork.RedisExtensions.RedisSubscribeInit.InitMq
{
    public sealed class InitMqBuilder
    {
        public InitMqBuilder(IServiceCollection services) => this.Services = services;

        public IServiceCollection Services { get; }

        private InitMqBuilder AddScoped(Type serviceType, Type concreteType)
        {
            this.Services.AddScoped(serviceType, concreteType);
            return this;
        }

        private InitMqBuilder AddSingleton(Type serviceType, Type concreteType)
        {
            ServiceCollectionServiceExtensions.AddSingleton(this.Services, serviceType, concreteType);
            return this;
        }
    }
}
